package binary;
//补码练习
public class ComplementDemo {
    public static void main(String[] args) {
        int n = 7;
        int m = ~n+1;
        int x = -12;
        int y = ~x+1;
        System.out.println(m);
        System.out.println(y);





















        /*
        int max = Integer.MAX_VALUE;
        max++;
        int min = Integer.MIN_VALUE;
        min--;
        System.out.println(Integer.toBinaryString(max));p
        System.out.println(Integer.toBinaryString(min));
        System.out.println(max);
        System.out.println(min);
        int n = -149;
        System.out.println(Integer.toBinaryString(n));

         */
    }
}
